package com.smh.a01ThreadDemo1;

public class ThreadDemo1 {
    public static void main(String[] args) {

        //继承Thread类
        //默认线程名字是Thread-线程号
        MyThread myThread = new MyThread();
        myThread.setName("t1");
        myThread.start();
        MyThread myThread2 = new MyThread();
        myThread2.setName("t2");
        myThread2.start();
        //交替执行

    }
}
